home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / page.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-05-07  |  4.0 KB  |  116 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.                           page.h  -  description
  9.                              -------------------
  10.     begin                : Sat Apr 7 2001
  11.     copyright            : (C) 2001 by Franz Schmid
  12.     email                : Franz.Schmid@altmuehlnet.de
  13.  ***************************************************************************/
  14.  
  15. /***************************************************************************
  16.  *                                                                         *
  17.  *   This program is free software; you can redistribute it and/or modify  *
  18.  *   it under the terms of the GNU General Public License as published by  *
  19.  *   the Free Software Foundation; either version 2 of the License, or     *
  20.  *   (at your option) any later version.                                   *
  21.  *                                                                         *
  22.  ***************************************************************************/
  23.  
  24. #ifndef PAGE_H
  25. #define PAGE_H
  26.  
  27. #include <utility>
  28.  
  29. #include <QList>
  30.  
  31. #include "scribusapi.h"
  32. #include "undostate.h"
  33. #include "scribusstructs.h"
  34. #include "guidemanagercore.h"
  35.  
  36. class PageItem;
  37. class QString;
  38. class UndoManager;
  39. class UndoState;
  40. class ScribusDoc;
  41.  
  42.  
  43. /**
  44.   *@author Franz Schmid
  45.   */
  46. class SCRIBUS_API Page : public UndoObject, public SingleObservable<Page>
  47. {
  48. public:
  49.     Page(const double x, const double y, const double b, const double h);
  50.     ~Page();
  51.     double xOffset() const { return m_xOffset; }
  52.     double yOffset() const { return m_yOffset; }
  53.     double width() const { return m_width; }
  54.     double height() const { return m_height; }
  55.     double initialWidth() const { return m_initialWidth; }
  56.     double initialHeight() const { return m_initialHeight; }
  57.     void setXOffset(const double);
  58.     void setYOffset(const double);
  59.     void setWidth(const double);
  60.     void setHeight(const double);
  61.     void setInitialWidth(const double);
  62.     void setInitialHeight(const double);
  63.     void copySizingProperties(Page *sourcePage, const MarginStruct& pageMargins);
  64.     MarginStruct Margins;
  65.     MarginStruct initialMargins;
  66.   /** Nummer der Seite */
  67.     int LeftPg;
  68.     //! Name of the master page that this page uses
  69.     QString MPageNam;
  70.  
  71.     QString m_pageSize;
  72.     int PageOri;
  73.     int marginPreset;
  74.     ScribusDoc* doc() const { return m_Doc; }
  75.     void setDocument(ScribusDoc* doc);
  76.     int pageNr() const { return m_pageNr; }
  77.     void setPageNr(int pageNr);
  78.     const QString& pageSectionNumber() const { return m_pageSectionNumber; }
  79.     void setPageSectionNumber(const QString&);
  80.     //! Return the page's name
  81.     const QString& pageName() const {return m_PageName;};
  82.     void setPageName(const QString& newName);
  83.     void restore(UndoState* state, bool isUndo);
  84.  
  85.     /*! \brief As a bit of a dirty hack, we declare this mutable so it can be altered
  86.     even while the object is `const'. That's normally only for internal
  87.     implementation, but in this case it at least lets us guarantee the rest
  88.     of the object is unchanged in (eg) pdflib. This should be replaced with
  89.     proper access methods later. */
  90.     mutable QList<PageItem*> FromMaster;
  91.     //! \brief Guides lists and basic operations
  92.     GuideManagerCore guides;
  93.  
  94. protected:
  95.     UndoManager * const undoManager;
  96.     void restorePageItemCreation(ItemState<PageItem*> *state, bool isUndo);
  97.     void restorePageItemDeletion(ItemState< QList<PageItem*> > *state, bool isUndo);
  98.     void restorePageItemConversion(ItemState<std::pair<PageItem*, PageItem*> >*state, bool isUndo);
  99.     
  100.     double m_xOffset;
  101.     double m_yOffset;
  102.     double m_width;
  103.     double m_height;
  104.     double m_initialWidth;
  105.     double m_initialHeight;
  106.     int m_pageNr;
  107.     //! Name of this page, currently only allowed to be used by a master page
  108.     QString m_PageName;
  109.     ScribusDoc* m_Doc;    
  110.     QString m_pageSectionNumber;
  111. };
  112.  
  113. Q_DECLARE_METATYPE(Page*);
  114.  
  115. #endif
  116.